package basic;

public class StrictFpDemo {
	public static void main(String[] args)

	{

		float aFloat = 0.6710339f;

		double aDouble = 0.04150553411984792d;

		double sum = aFloat + aDouble;

		float quotient = (float) (aFloat / aDouble);

		System.out.println("float: " + aFloat);

		System.out.println("double: " + aDouble);

		System.out.println("sum: " + sum);

		System.out.println("quotient: " + quotient);

	}
}

// Example of precision control with strictfp:

class MyClass2

{

	public float	aFloat;

	public double	aDouble;

	public MyClass2() {
	}

	public strictfp double add(float a, double b)

	{

		return (a + b);

	}

	public static void main(String[] args)

	{

		MyClass2 myClass2 = new MyClass2();

		myClass2.aFloat = 0.6710339f;

		myClass2.aDouble = 0.04150553411984792d;

		double sum = myClass2.add(myClass2.aFloat, myClass2.aDouble);

		System.out.println("float: " + myClass2.aFloat);

		System.out.println("double: " + myClass2.aDouble);

		System.out.println("sum: " + sum);

	}

}
